#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <set>
using namespace std;
void Qsort(string &s, int l, int r)
{
    if (l >= r)
        return;
    swap(s[(l + r) / 2], s[r]);
    int pivot = s[r], i = l - 1;
    for (int j = l; j < r; ++j)
    {
        if (s[j] < pivot)
            swap(s[++i], s[j]);
    }
    swap(s[i + 1], s[r]);
    Qsort(s, l, i);
    Qsort(s, i + 2, r);
}
class Solution
{
public:
    bool isAnagram(string s, string t)
    {
        Qsort(s, 0, s.length() - 1);
        Qsort(t, 0, t.length() - 1);
        return s == t;
    }
};